import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      meta: {
        // 需要缓存
        keepAlive: true
      }
    },
    {
      path: '/processed',
      name: 'processed',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/ProcessedView.vue'),

      meta: {
        // 不需要缓存
        keepAlive: false
      }
    },
    {
      path: '/pre',
      name: 'pre',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/PreView.vue'),

      meta: {
        // 不需要缓存
        keepAlive: false
      }
    },
    {
      path: '/stop',
      name: 'stop',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/StopView.vue'),

      meta: {
        // 不需要缓存
        keepAlive: false
      }
    },
    {
      path: '/origin',
      name: 'origin',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/OriginView.vue'),
      meta: {
        // 不需要缓存
        keepAlive: false
      }
    },
    {
      path: '/details',
      name: 'details',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/DetailView.vue'),
      meta: {
        // 不需要缓存
        keepAlive: false
      }
    },


  ]
})

export default router
